package com.gxa.medical.util;

import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

//自定义的map类型的工具用于给Jackson快速生成json文件
@Configuration
public class JsonResult {
    private Map<String, Object> resultMap = new HashMap<>();

    public void setCode(String code) {
        resultMap.put("code", code);
    }

    public void setMsg(String msg) {
        resultMap.put("msg", msg);
    }

    public void setData(Object value) {
        resultMap.put("data", value);
    }

    public void set(String name, Object value) {
        resultMap.put(name, value);
    }

    public Map<String, Object> getResultMap() {
        return resultMap;
    }
}
